import http from "../../request.js"

// 获取收货地址列表列表
function findAllAddress(data) {
	return http({
		url: `/lejuClient/address/findAllAddress`,
		data: data, //1308336521604599809
		method: "GET"
	})
}


// 添加地址
function addAddressInfo(data) {
	return http({
		url: `/lejuClient/address/addAddressInfo`,
		data: data, //1308336521604599809
		method: "POST"
	})
}


// 删除地址
function delAddressInfo(id, data) {
	return http({
		url: `/lejuClient/address/delAddressInfo/${id}`,
		data: data, //1308336521604599809
		method: "DELETE"
	})
}


// 设为默认地址
function makeAddressDefaul(id, data) {
	return http({
		url: `/lejuClient/address/makeAddressDefaul/${addressId}`,
		data: data, //1308336521604599809
		method: "POST"
	})
}

// 设为默认地址
function switchDefault(id, status, data) {
	return http({
		url: `/lejuClient/address/switchDefault/${id}/${status}`,
		data: data, //1308336521604599809
		method: "POST"
	})
}

// 修改地址
function updateAddressInfo(data) {
	return http({
		url: `/lejuClient/address/updateAddressInfo`,
		data: data, //1308336521604599809
		method: "POST"
	})
}


export {
	findAllAddress,
	addAddressInfo,
	delAddressInfo,
	makeAddressDefaul,
	updateAddressInfo,
	switchDefault
}
